import request from '@/utils/request';

// 获取奖惩列表
export function getRewardList(params: any) {
    return request({
        url: '/api/reward',
        method: 'get',
        params
    });
}

// 获取奖惩详情
export function getRewardDetail(id: number) {
    return request({
        url: `/api/reward/${id}`,
        method: 'get'
    });
}

// 创建奖惩
export function createReward(data: any) {
    return request({
        url: '/api/reward',
        method: 'post',
        data
    });
}

// 更新奖惩
export function updateReward(data: any) {
    return request({
        url: `/api/reward/${data.id}`,
        method: 'put',
        data
    });
}

// 删除奖惩
export function deleteReward(id: number) {
    return request({
        url: `/api/reward/${id}`,
        method: 'delete'
    });
}

// 批量删除奖惩
export function batchDeleteReward(ids: number[]) {
    return request({
        url: '/api/reward/batch',
        method: 'post',
        data: ids
    });
}


export function getStudentList() {
    return request({
        url: '/api/reward/student',  // 假设接口返回 [{ id, name }]
        method: 'get'
    })
}

export function getTeacherList() {
    return request({
        url: '/api/reward/teacher',  // 假设接口返回 [{ id, name }]
        method: 'get'
    })
}



